home *** CD-ROM | disk | FTP | other *** search
- ;========================================================================================
- ;
- ; File: FWGlue.asm
- ; Release Version: $ 1.0d11 $
- ;
- ; Creation Date: 3/28/94
- ;
- ; Copyright: (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
- ;
- ;========================================================================================
-
- LOCALS ; Yes, we want local symbols on (those prefixed with a @@)
- Model Large ; Large memory model
- .286 ; Enable i286 instructions for things like "PUSHALL"
-
- %NOINCL
- include macros.asm
-
- c_name _trace_pro_f
- c_name _trace_epi_f
-
- public _trace_pro_f
- public _trace_epi_f
-
- extrn ?TraceIn@_FW_CTraceRuntime@@TAXXZ:far ; _FW_CTraceRuntime::TraceIn()
- extrn ?TraceOut@_FW_CTraceRuntime@@TAXXZ:far ; _FW_CTraceRuntime::TraceOut()
-
- begdata
-
- ;========================================================================================
- ; We might call a tracer that's itself compiled with tracing on. To prevent
- ; infinite loops, stack faults, nuclear disasters, etc., we have this little
- ; varibale here that we use as a semaphore
- ;========================================================================================
-
- nTraceNesting dw 0
-
- enddata
-
- begcode Trace
-
- PushAll macro
- pusha
- pushf
- push ES
- push DS
- endm
-
- PopAll macro
- pop DS
- pop ES
- popf
- popa
- endm
-
- ;========================================================================================
- ; _trace_pro_f
- ;
- ; Called by SymC++ when a function is entered.
- ;========================================================================================
-
- func _trace_pro_f
-
- WINENTER
-
- PushAll
-
- mov AX, DGROUP
- mov DS, AX
-
- inc nTraceNesting
-
- cmp nTraceNesting, 1
- jne _pro_exit
-
- call ?TraceIn@_FW_CTraceRuntime@@TAXXZ
-
- mov AX, DGROUP
- mov DS, AX
-
- _pro_exit:
- dec nTraceNesting
-
- PopAll
-
- WINLEAVE
- retf
-
- c_endp _trace_pro_f
-
- ;========================================================================================
- ; @_trace_epi_f()
- ;
- ; Called by SymC++ when a function is exited.
- ;========================================================================================
-
- func _trace_epi_f
-
- WINENTER
-
- PushAll
-
- mov AX, DGROUP
- mov DS, AX
-
- inc nTraceNesting
-
- cmp nTraceNesting, 1
- jne _epi_exit
-
- call ?TraceOut@_FW_CTraceRuntime@@TAXXZ
-
- mov AX, DGROUP
- mov DS, AX
-
- _epi_exit:
- dec nTraceNesting
-
- PopAll
-
- WINLEAVE
- retf
-
- c_endp _trace_epi_f
-
- endcode Trace
- end
-